import request from '@/utils/request'

// 获取总体统计数据
export function getOverview() {
  return request({
    url: '/system/statistics/overview',
    method: 'get'
  })
}

// 获取用户增长统计
export function getUserGrowth(days = 7) {
  return request({
    url: '/system/statistics/userGrowth',
    method: 'get',
    params: { days }
  })
}

// 获取内容统计
export function getContentStats(days = 7) {
  return request({
    url: '/system/statistics/content',
    method: 'get',
    params: { days }
  })
}

// 获取热门圈子统计
export function getHotTopics(limit = 10) {
  return request({
    url: '/system/statistics/hotTopics',
    method: 'get',
    params: { limit }
  })
}

// 获取热门帖子统计
export function getHotPosts(limit = 10) {
  return request({
    url: '/system/statistics/hotPosts',
    method: 'get',
    params: { limit }
  })
}

// 获取活跃用户统计
export function getActiveUsers(limit = 10) {
  return request({
    url: '/system/statistics/activeUsers',
    method: 'get',
    params: { limit }
  })
}

// 获取数据趋势
export function getTrends(days = 30) {
  return request({
    url: '/system/statistics/trends',
    method: 'get',
    params: { days }
  })
}

// 导出统计报告
export function exportStatistics(query) {
  return request({
    url: '/system/statistics/export',
    method: 'post',
    params: query
  })
}